// 常规子弹碰撞特效
class NormalSpecialEffect {
    constructor(id, bullet_level, create_point, effect_radius, ctx) {
        this.id = id
        this.bullet_level = bullet_level
        this.point = create_point
        this.ctx = ctx
        // 特效是否达到最大效果， 达到后就开始收缩
        this.effect_is_max = false
        // 特效的最大半径
        this.max_radius = effect_radius + this.bullet_level
        // 特效的当前半径
        this.current_radius = 1
        // 会有的一些特征
        /*
        * 1、坐标点
        * 2、效果等级
        * 3、效果过度
        * */
    }
    // 特效绘制
    drawEffect() {
        if (!this.effect_is_max && ++this.current_radius >= this.max_radius) {
            this.effect_is_max = true
        } else if (this.effect_is_max) {
            this.current_radius--
        }
        this.ctx.save()
        this.ctx.strokeStyle = '#d4701f'
        this.ctx.strokeWidth = '20px'
        this.ctx.beginPath()
        this.ctx.arc(this.point[0], this.point[1], this.current_radius, 0, 2 * Math.PI)
        this.ctx.stroke()
        this.ctx.closePath()
        this.ctx.restore()
        this.deleteEffect()
    }
    // 删除当前特效
    deleteEffect() {
        if (this.current_radius <= 0) {
            special_effects_list.delete(this.id)
        }
    }
}
